package gam.n1.achievement.n;

import gam.n1.achievement.iAchievement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.function.Supplier;

public class FloatAchievement extends BaseAchievement<Float>{
    public FloatAchievement(@NotNull Supplier<Float> initValue, @Nullable String name) {
        super(initValue, name);
    }

    @Override
    public void set(Float aFloat) {
        $t = aFloat >= Float.MAX_VALUE || aFloat <= Float.MIN_VALUE ? 0f : aFloat;
    }

    @Override
    public Class<Float> t() {
        return Float.class;
    }

    @Override
    public iAchievement<Float> copy() {
        return new FloatAchievement(valueF,name);
    }
}
